package com.lyf.aop.sguigu;

import com.lyf.aop.sguigu.controller.LoginController;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @AUTHOR LYF
 * @DATE 2022/5/15
 * @VERSION 1.0
 * @DESC
 */
//@EnableAspectJAutoProxy
//@ComponentScan("com.lyf.aop")
public class MainApp {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
                new AnnotationConfigApplicationContext("/com/lyf/aop");
       // applicationContext.getBean("LoginController");
        String [] names = applicationContext.getBeanDefinitionNames();
        for(String name:names){
            System.out.println(name);
        }
        LoginController loginController = (LoginController) applicationContext.getBean("loginController");
        String rs = loginController.login("hello","hhhh");
        System.out.println("RS::>>>"+rs);

    }
}
